You are here: Using Condition Tables and the Record Dictionary > Using Condition Tables > Creating a Conditions File > Occurrence Counting

Occurrence Counting

Occurrence counting uses the following format:

OccurName : OCCURRENCE(RecordName,ConditionName) MAX(Count)

Here is an example:

Occur1 : OCCURRENCE(Detail,Cond4)

The record Detail and the condition Cond4 are used above as defined in the previous examples. The occurrence condition Occur1 is driven by the record named Detail. The record must be of Repeating type.

The condition Cond4 references the variable CustomerType. CustomerType is defined on the Detail record. There must be a connection between the record and a variable in the condition for the occurrence count to work correctly.

<Conditions>

MSG1 : LNPRTY < 10000

MSG2 : LNPRTY >= 10000

MSGTRGR1 : Occurrence(Message, MSG1)

totcurrchrg : DTLSECTION = "01" and LNPRIORITY != 00625

totamtdb : TOTAL >= 0 AND BBFLAG = "N"

env : EDIVERT ="0"

emitgrapha : GRAPHTRUE = "28" AND SCALETRUE = "29" AND BUDBLTRUE = "N"

*Triggers grouping for Tariff, Rider and Detail records

IAMBDTLA : DTLKeyProd = TARKeyProd and DTLTarSeqNo = TARTarSeqNo

REMAINDER : USAGEREM != 0

REGTARIFF : Occurrence(Tariff, REGBUS)

REGBUS : CDBUS != "0700" and CDBUS != "0100"

Setting a maximum count to return

Include the MAX parameter if you want to set a maximum count to be returned. Here is an example of the format for occurrence counting. Here is an example:

Occur1 : OCCURRENCE(Detail,Cond4) MAX(5)

Assume Cond4 is defined as shown here:

Cond4 : CustomerType = "A"

The occurrence condition Occur1 is driven by the record named Detail. The record must be of Repeating type.

Condition tables and the RecipCondition rule

One example of using Condition tables is to call the RecipCondition rule. In the SETRCPTB.DAT file, call the rule, as shown here:

;ORACLE;REGION2;REG;;01;;;M0;0;0;0;;RecipCondition;Cond1;

;ORACLE;REGION2;REG;;01;;;M0;0;0;0;;RecipCondition;Occur1;